package com.zbkj.front.controller.v2;


import com.zbkj.dal.base.result.CommonResult;
import com.zbkj.front.model.vo.CooperateMerchantInfoVO;
import com.zbkj.front.model.vo.CooperateMerchantListVO;
import com.zbkj.front.service.CooperateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Api("合作相关")
@RestController
@RequestMapping("/api/front/v2/cooperate")
public class CooperateController {

    @Resource
    private CooperateService cooperateService;

    @ApiOperation(value = "合作商户列表")
    @GetMapping("/merchant/list")
    public CommonResult<List<CooperateMerchantListVO>> cooperateMerchant() {
        return CommonResult.success(cooperateService.cooperateMerchant());
    }

    @ApiOperation(value = "合作商户信息")
    @GetMapping("/merchant/info")
    public CommonResult<CooperateMerchantInfoVO> cooperateMerchantInfo(@RequestParam("cooperateMerchantCode") String cooperateMerchantCode) {
        return CommonResult.success(cooperateService.cooperateMerchantInfo(cooperateMerchantCode));
    }

}
